package com.cyberypower.sjs.common;

import org.apache.log4j.PropertyConfigurator;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;


public class Log {


    public static String cut(String st) {
        if (st.length() < Config.DEBUG_LENGTH)
            return st;
        else return st.substring(0, Config.DEBUG_LENGTH);
    }

    public static void init() {
        try {
            Properties logProperties = new Properties();
            logProperties.load(new FileInputStream(Config.LOG4J_PATH));
            PropertyConfigurator.configure(logProperties);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private Log() {
    }

    public static void infoSameLn(String s) {
        System.out.print(s);
    }
}
